﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace yq.Task
{
    /// <summary>
    /// 执行反射
    /// </summary>
    public class ReflectionLoad
    {
        /// <summary>
        /// 执行反射
        /// </summary>
        /// <param name="namespaceClass"></param>
        /// <param name="model"></param>
        /// <param name="cn"></param>
        /// <returns></returns>
        public bool Operating(string namespaceClass, string taskId, string json)
        {
            Type _type = Type.GetType(namespaceClass);
            if (_type != null)
            {
                ITask _o = Activator.CreateInstance(_type) as ITask;
                if (_o != null)
                {
                    return _o.Operating(taskId, json);
                }
            }
            return false;
        }
    }
}
